@extends('admin.layouts.layout')
@section('content')
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-title">
                <h5>编辑游戏</h5>
            </div>
            <div class="ibox-content">
                <a class="menuid btn btn-primary btn-sm" href="{{getBackUrl()}}">返回</a>
                <div class="hr-line-dashed m-t-sm m-b-sm"></div>
                <form class="form-horizontal m-t-md" action="{{ route('games.update',$game->id) }}" method="post"
                      accept-charset="UTF-8" enctype="multipart/form-data">
                    {!! csrf_field() !!}
                    {{method_field('PATCH')}}
                    <input type="hidden" name="goBackUrl" value="{{getBackUrl()}}"/>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">游戏ID：</label>
                        <div class="input-group col-sm-2">
                            <input type="text" class="form-control" name="game_id"
                                   value="<?php echo old('game_id') == null ? $game->game_id : old('game_id');?>"
                                   required
                                   data-msg-required="请输入游戏ID" autocomplete="off">
                            @if ($errors->has('game_id'))
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>{{$errors->first('game_id')}}</span>
                            @endif
                        </div>
                    </div>

                    <div class="hr-line-dashed m-t-sm m-b-sm"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">游戏名称：</label>
                        <div class="input-group col-sm-2">
                            <input type="text" class="form-control" name="game_name"
                                   value="<?php echo old('game_name') == null ? $game->game_name : old('game_name');?>"
                                   required
                                   data-msg-required="请输入游戏名称" autocomplete="off">
                            @if ($errors->has('game_name'))
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>{{$errors->first('game_name')}}</span>
                            @endif
                        </div>
                    </div>

                    <div class="hr-line-dashed m-t-sm m-b-sm"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">游戏类名：</label>
                        <div class="input-group col-sm-2">
                            <input type="text" class="form-control" name="model_name"
                                   value="<?php echo old('model_name') == null ? $game->model_name : old('model_name');?>"
                                   required
                                   data-msg-required="请输入游戏类名" autocomplete="off">
                            @if ($errors->has('model_name'))
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>{{$errors->first('model_name')}}</span>
                            @endif
                        </div>
                    </div>

                    <div class="hr-line-dashed m-t-sm m-b-sm"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态：</label>
                        <div class="input-group col-sm-1">
                            <select class="form-control" name="status">
                                <option value="1" @if($game->status == 1) selected="selected" @endif>正常</option>
                                <option value="2" @if($game->status == 2) selected="selected" @endif>锁定</option>
                            </select>
                            @if ($errors->has('status'))
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>{{$errors->first('status')}}</span>
                            @endif
                        </div>
                    </div>
                    <div class="hr-line-dashed m-t-sm m-b-sm"></div>
                    <div class="form-group">
                        <div class="col-sm-12 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit"><i class="fa fa-check"></i>&nbsp;保 存</button>
                            <button class="btn btn-white" type="reset"><i class="fa fa-repeat"></i> 重 置</button>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </form>
            </div>
        </div>
    </div>
@endsection